SELECT
<#assign prefixName=' '>
<#if (select__id??)>
${prefixName} T.ID AS id
	<#assign prefixName=','>
</#if>
<#if (select__endDaTi??)>
${prefixName} T.END_DA_TI AS endDaTi
	<#assign prefixName=','>
</#if>
<#if (select__resourceId??)>
${prefixName} T.RESOURCE_ID AS resourceId
	<#assign prefixName=','>
</#if>
<#if (select__validateFalseId??)>
${prefixName} T.VALIDATE_FALSE_ID AS validateFalseId
	<#assign prefixName=','>
</#if>
<#if (select__validateRuId??)>
${prefixName} T.VALIDATE_RU_ID AS validateRuId
	<#assign prefixName=','>
</#if>
<#if (select__validateTrueId??)>
${prefixName} T.VALIDATE_TRUE_ID AS validateTrueId
	<#assign prefixName=','>
</#if>
<#if (select__orderNum??)>
${prefixName} T.ORDER_NUM AS orderNum
	<#assign prefixName=','>
</#if>
<#if (select__beginDaTi??)>
${prefixName} T.BEGIN_DA_TI AS beginDaTi
	<#assign prefixName=','>
</#if>
<#if prefixName == ' '>
  T.ID AS id
, T.END_DA_TI AS endDaTi
, T.RESOURCE_ID AS resourceId
, T.VALIDATE_FALSE_ID AS validateFalseId
, T.VALIDATE_RU_ID AS validateRuId
, T.VALIDATE_TRUE_ID AS validateTrueId
, T.ORDER_NUM AS orderNum
, T.BEGIN_DA_TI AS beginDaTi
</#if>
FROM FD_RESOURCE_VA_RU_TR_MO T
<#include "whereResourceVaRuTrMoBy1.ftl">
<#assign prefixName='ORDER BY'>
<#if (order__by__id??)>
${prefixName} T.ID ${order__by__id__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__endDaTi??)>
${prefixName} T.END_DA_TI ${order__by__endDaTi__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__resourceId??)>
${prefixName} T.RESOURCE_ID ${order__by__resourceId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__validateFalseId??)>
${prefixName} T.VALIDATE_FALSE_ID ${order__by__validateFalseId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__validateRuId??)>
${prefixName} T.VALIDATE_RU_ID ${order__by__validateRuId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__validateTrueId??)>
${prefixName} T.VALIDATE_TRUE_ID ${order__by__validateTrueId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__orderNum??)>
${prefixName} T.ORDER_NUM ${order__by__orderNum__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__beginDaTi??)>
${prefixName} T.BEGIN_DA_TI ${order__by__beginDaTi__value!}
	<#assign prefixName=','>
</#if>
